package com.cloud.pay.constant;

import com.cloud.common.bean.ResultInfo;
import lombok.Getter;

public enum ErrorEnum {

    EXIST(600, "已存在"),
    NOT_EXIST(601, "不存在"),
    PAID(602, "已付款"),
    NOT_PAID(603, "未付款"),
    REFUNDED(604, "已退款");


    @Getter
    private int code;

    @Getter
    private String message;

    public <T> ResultInfo<T> resultInfo() {
        return ResultInfo.failure().setCode(code).setMessage(message);
    }

    ErrorEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

}
